<!--{json width:"550",title:"置顶操作"}-->
<form action="?mod-top-fid-$fid-fid_tids-$fid_tids-ajax-1.htm" method="post" id="mod_top_form">
	<input type="hidden" name="FORM_HASH" value="{FORM_HASH}" />
	<dl>
		<dt><label>主题：</label></dt>
		<dd>$threads (篇)</dd>
		
		<dt><label>置顶范围：</label></dt>
		<dd>
			<input type="radio" name="rank" id="top_0" value="0" checked="checked" /><label for="top_0">取消置顶</label>
			<input type="radio" name="rank" id="top_1" value="1" /><span class="icon icon-top-1"></span><label for="top_1">分类置顶</label>
			<input type="radio" name="rank" id="top_2" value="2" /><span class="icon icon-top-2"></span><label for="top_2">热门置顶</label>
			<input type="radio" name="rank" id="top_3" value="3" /><span class="icon icon-top-3"></span><label for="top_3">最新置顶</label>
		</dd>
		
		<dt><label for="top_comment">备注：</label></dt>
		<dd>
			<textarea name="comment" id="top_comment" style="width: 350px; height: 40px;" onkeyup="if(this.value.length > 64) {alert('最多只能输入64个字符。'); return false;}"></textarea>
		</dd>
		
<!-- 		<dt><label>通知作者：</label></dt>
		<dd><input type="checkbox" name="systempm" value="1" checked="checked" /></dd> -->
		
		<dt></dt>
		<dd>
			<input type="submit" class="button bigblue" id="mod_top_submit" value="确定" />
			<input type="button" class="button biggrey" value="关闭" id="mod_top_cancel"/>
		</dd>
	</dl>
</form>

<script type="text/javascript">
function delay_execute(dialog, recall) {
	// 延迟执行的脚本，约定名字为：delay_execute()

	$('#mod_top_submit').focus();
	$('#mod_top_submit').click(function() {
		$('#mod_top_submit').disable();
		var postdata = $("#mod_top_form").serialize();
		$.post($('#mod_top_form').attr('action'), postdata,  function(s){
			$('#mod_top_submit').enable();
			var json = json_decode(s);
			if(error = json_error(json)) {alert(error); return false;}
			if(!json.status > 0) {
				dialog.set_body('<div class="error">'+json.message+'！</div>');
				return false;
			}
			dialog.set_body('<div class="ok">'+json.message+'！</div>');
			setTimeout(function(){
 				dialog.close(true);
	 			if(recall) recall();
	 		}, 1000);
		});
		return false;
	});
	
	$('#mod_top_cancel').click(function() {
		dialog.close(true);
		return false;
	});
	
	$('#top_$thread[top]').attr('checked', 'checked');
}
</script>